#ifndef __MY_DEBUG_H__
#define __MY_DEBUG_H__
#include <stdexcept>
#include <string>

#define CheckNullPtr(x)                                     \
if (x == nullptr) {                                         \
    throw std::runtime_error(std::string(SDL_GetError() +   \
    std::string("in line ")  + std::to_string(__LINE__) +   \
    std::string(" in file ") + std::string(__FILE__)));     \
} 

#define CheckFunc(x)                                        \
if (x < 0) {                                                \
    throw std::runtime_error(std::string(SDL_GetError() +   \
    std::string("in line ")  + std::to_string(__LINE__) +   \
    std::string(" in file ") + std::string(__FILE__)));     \
}

#endif